#include <iostream>
#include <stdio.h>

#include <iostream>
#include <memory>
#include <vector>

using namespace std;

class Solution
{
public:
    int removeElement(vector<int> &nums, int target)
    {
        int slowIndex = 0;
        for(int fastIndex = 0; fastIndex < nums.size(); fastIndex++){
            if(nums[fastIndex] != target){
                nums[slowIndex++] = nums[fastIndex];
            }
        }

        return slowIndex;
    }
};

int main(int argv, char**argc)
{

    printf("************  test hello zc!!!   **************\n");
    /* add test code! */
    Solution solver;
    vector<int> vecs = {0,1,2,2,3,0,4,2};
    int ret = solver.removeElement(vecs, 2);

    if(ret !=0){
        for(int i = 0; i < ret; i++){
            
            printf("  %d", vecs[i]);
        }
    }

    return 0;
}
